import java.lang.reflect.Array;
import java.util.*;

public class Text {
    public boolean isSubsequence (String S, String T) {
        // write code here
        if (T.contains(S)) {
            return true;
        }
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < T.length(); i++) {
            char ch = T.charAt(i);
            set.add(ch);
        }
        for (int i = 0; i < S.length(); i++) {
            char ch = S.charAt(i);
            if ( !set.contains(ch)) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String s = in.nextLine();
            StringBuilder stringBuilder = new StringBuilder(s);
            s = deletedSame(stringBuilder);
            if(s.length() == 0) {
                System.out.println(0);
            }
            System.out.println(s);
        }
    }
    public static String deletedSame(StringBuilder stringBuilder) {
        for (int i = 0; i < stringBuilder.length(); i++) {
            char ch = stringBuilder.charAt(i);
            if (i + 1 < stringBuilder.length() && ch == stringBuilder.charAt(i+1)) {
                stringBuilder.delete(i,i+2);
                i = -1;
            }
        }
        return stringBuilder.toString();
    }
}
